{{ include("common/header.html")}}

<div class="layui-container fly-marginTop fly-user-main">
  {{ include("users/usernav.html")}}
  <div class="fly-panel fly-panel-user" pad20>
    <!--
    <div class="fly-msg" style="margin-top: 15px;">
      您的邮箱尚未验证，这比较影响您的帐号安全，<a href="activate.html">立即去激活？</a>
    </div>
    -->
    <div class="layui-tab layui-tab-brief" lay-filter="user">
      <ul class="layui-tab-title" id="LAY_mine">
        <li data-type="mine-jie" lay-id="index" class="layui-this">我发的帖（<span>{{userPostNum['num']}}</span>）</li>
       <!-- <li data-type="collection" data-url="/collection/find/" lay-id="collection">我收藏的帖（<span>16</span>）</li>-->
      </ul>
      <div class="layui-tab-content" style="padding: 20px 0;">
        <div class="layui-tab-item layui-show">
          <ul class="mine-view jie-row">
            {% for data in postList.list %}
            <li>
              <a class="jie-title" href="{{SUFFIX}}detail-{{data.id}}" target="_blank">{{data.title}}</a>
              <i>{{data.create_time|date('Y-m-d H:i:s')}}</i>
              <a class="mine-edit" href="{{SUFFIX}}post-edit',{{data.id}}" target="_blank">编辑</a>
              <em>{{data.visits_count}}阅/{{data.reply_count}}答</em>
            </li>
            {%endfor%}
          </ul>
          <div style="text-align: center">
            <!-- <div class="laypage-main"> -->
            <div id="pages"></div>
            <!-- </div> -->
          </div>
        </div>
        <div class="layui-tab-item">
          <ul class="mine-view jie-row">
            <li>
              <a class="jie-title"  target="_blank"></a>
              <i>收藏于23小时前</i>  </li>
          </ul>
          <div id="LAY_page1"></div>
        </div>
      </div>
    </div>
  </div>
</div>　
<script>
    /**
     * 构造分页功能
     */

    layui.use('laypage', function(){
        var laypage = layui.laypage;
        //完整功能
        laypage.render({
            elem: 'pages',
            count: "{{pagination.total}}", //数据总数，从服务端得到
            last:'尾页',
            limit:"{{pagination.page_size}}",
            curr:"{{pagination.current_page}}",
            // layout: ['prev', 'page', 'next'],
            jump: function(obj,first){
                var url="{{ G.url('app/users/index',{'current_page':'currs','page_size':'limit'})}}";
                /**
                 * 替换处理
                 * @type {string}
                 */
                url = url.replace("currs", obj.curr);
                url = url.replace("limit", obj.limit);
                //首次不执行
                if(!first){
                    window.location.href=escapeUrl(url);//转义amp字符
                }
            }
        });

    });

</script>
{{ include("common/footer.html")}}